<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY copy "&#169;">
  <!ENTITY nbsp "&#160;">
  <!ENTITY laquo "&#171;">
  <!ENTITY raquo "&#187;">
]>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

    <!-- xsl:include href="../list.xsl"/ -->
    <xsl:include href="../newlist.xsl"/>

    <xsl:template match="/">
        <xsl:apply-templates />
    </xsl:template>

    <xsl:template match="content">
        <link href="/js/jquery-ui/css/smoothness/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/js/jquery-ui/jquery-ui-1.8.18.custom.min.js" />
        <script type="text/javascript" src="/js/jquery-ui/jquery.ui.widget.js" />
        <script type="text/javascript" src="/js/auction_add_lot.js" />

        <style type="text/css">
            .ui-button-text {
            	font: 8pt arial !important;
            }
        </style>

        <div class="contenthead">
            <xsl:call-template name="Create_Path">
                <xsl:with-param name="last">
                    <xsl:text>Лоти</xsl:text>
                </xsl:with-param>
            </xsl:call-template>
            <div class="top">
                <span class="title">
                    <xsl:text>Лоти аукціону №</xsl:text><xsl:value-of select="$Main/@id"/>
                </span>
                <xsl:if test="$Form/auction_status = 0 or $Form/auction_status = 3 or normalize-space($User/role_id) = '12' or normalize-space($User/role_id) = '1'">                                
                    <span class="actions">
                        <input id="button_add_lot" value="Додати лот" type="button" />
                    </span>
                </xsl:if>
            </div>
        </div>

        <div class="aside">
            <div class="head-slide on">
                Фільтри
            </div>
            <div class="container">
                <form action="/{$Controller}/lots/{$Main/@id}" method="post" name="filter" class="filter">
                    <fieldset>
                        <ul class="editlist">
                            <li>
                                <label>Дата початку аукціону</label>
                                <select name="by_gone"> 
                                    <xsl:if test="not($Form/is_gone/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="-1">
                                        Не вказано
                                    </option>
                                    <xsl:for-each select="$Form/is_gone/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li>
                                <label>За кадастровим номером</label>
                                <input name="by_cad_num" value="{$Form/by_cad_num}" class="broad100" type="text" />
                            </li>
                            <li>
                                <label>Статус</label>
                                <select name="by_status" id="by_status">
                                    <xsl:if test="not($Form/id_status/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="0">
                                        Не вказано
                                    </option>
                                    <xsl:for-each select="$Form/id_status/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li id="by_approved" style="display:none;">
                                <label>Підтверження</label>
                                <select name="by_approved"> 
                                    <xsl:if test="not($Form/is_approved/row)">
                                        <xsl:attribute name="disabled">disabled</xsl:attribute>
                                    </xsl:if>
                                    <option value="-1">
                                        Не вказано
                                    </option>
                                    <xsl:for-each select="$Form/is_approved/row">
                                        <option value="{id}">
                                            <xsl:if test="@active">
                                                <xsl:attribute name="selected">selected</xsl:attribute>
                                            </xsl:if>
                                            <xsl:value-of select="name" />
                                        </option>
                                    </xsl:for-each>
                                </select>
                            </li>
                            <li class="submit">
                                <input name="save" type="submit" id="save" style="font-weight: bold;" value="Застосувати" />
                                <input name="reset" type="submit" id="reset" value="Показати все" />
                            </li>
                        </ul>
                    </fieldset>
                </form>
            </div>

        </div>

        <div class="article">
            <xsl:call-template name="Messages" />

            <div class="innerNav">
                <ul>
                    <li>
                        <a href="/{$Controller}/view/{$Main/@id}">Аукціон</a>
                    </li>
                    <li>
                        <a href="/{$Controller}/lots/{$Main/@id}" class="on">
                            <xsl:text>Лоти</xsl:text>
                            <xsl:if test="normalize-space($Form/lots_count/text()) != ''">
                                <xsl:text> (</xsl:text>
                                <xsl:value-of select="$Form/lots_count"/>
                                <xsl:text>)</xsl:text>
                            </xsl:if>
                        </a>
                    </li>
                    <li>
                        <a href="/{$Controller}/auction-history/{$Main/@id}">Історія</a>
                    </li>
                </ul>
                <br class="spacer"/>
            </div>

            <div class="sort">
                <span>З виділеними:</span>
                <a href="javascript:;" id="lot_button_status">На перевірку</a>
                <a href="javascript:;" id="lot_button_remove">Видалити</a>
                <xsl:if test="$User/role_id = 12">
                <a href="javascript:;" id="lot_button_publish">Опублікувати</a>
                </xsl:if>
            </div>

			<input type="hidden" id="lotid" name="lotid" value="{$Main/@id}" />
            <input type="hidden" id="remove_lots_action" value="/{$Controller}/remove-lot/{$Main/@id}" />
            <!--xsl:apply-templates select="Main/List" /-->
            <xsl:call-template name="List">
					<xsl:with-param name="Node" select="Main/List"/>
					<xsl:with-param name="listName" select="'List'"/>
			</xsl:call-template>
        </div>

        <div id="add-lot-dialog">
            <form action="/{$Controller}/add-lot/{$Main/@id}" method="post" name="form" id="add-lot-form" enctype="multipart/form-data" >
                <div style="text-align: center; padding-top: 25px;">
                    <input id="file-name" type="file" name="file_name" required="true" size="35"/>
                </div>
            </form>
        </div>
    </xsl:template>

</xsl:stylesheet>
